<{include file="../common/header.tpl"}>
<link href="/css/uploadify.css" rel="stylesheet">
<table width="100%" border="0" cellspacing="0">
 <tr>
       <td width="13%" valign="top">
           <{include file="../common/left.tpl"}>
       </td>
       <td width="87%" valign="top">

               <table width="100%" border="0" cellspacing="0">
                 <tr>
                       <td>
                        <div class="subnav">
                          <div class="content-menu ib-a blue line-x"> 
                              <a href="/webadmin/staff/list?network_id=<{$network_id}>"><em>员工管理</em></a><span>|</span>
                                <a href="javascript:;" class="on"><em><{if $info}>编辑员工<{else}>添加员工<{/if}></em></a>
                           <div class="clearbox"></div>
                          </div>
                        </div>
                           
                            <div class="pad_10">
                              <div class="table-list">
                                    <div class="common-form">
                                        <form name="myform" action="<{if $info}>/webadmin/staff/doEdit<{else}>/webadmin/staff/doAdd<{/if}>" method="post" id="myform">
                                        <table width="100%" class="table_form contentWrap">
                                        <tbody>
                                        <tr>
                                            <td width="80">员工编号</td> 
                                            <td>
                                                <input type="text" name="staff_identifier" value="<{$info.staff_identifier}>" class="input-text" id="staff_identifier">
                                            </td>
                                        </tr>
                                        <tr>
                                        <td width="80">头像</td> 
                                        <td><label>
                                          <input type="file" name="uploadify" id="uploadify" />
                                        </label>
                                            <input type="hidden" name="photo" id="cover" value="<{$info.photo}>">
                                            <div id="cases_img"><{if $info.photo}><img src="<{$info.photo}>" class="img-responsive"><{/if}></div>
                                        </td>
                                        </tr>
                                        <tr>
                                            <td width="80">员工姓名</td> 
                                            <td><input type="text" name="staff_name" value="<{$info.staff_name}>" class="input-text" id="staff_name"></td>
                                        </tr>

                                        <tr>
                                            <td width="80">岗位</td> 
                                            <td><input type="text" name="station" value="<{$info.station}>" class="input-text" id="station"></td>
                                        </tr>
                                        <tr>
                                            <td width="80">是否临柜</td> 
                                            <td>
                                                <input type="checkbox" name="temporary" <{if $info.temporary}>checked="checked"<{/if}> >是
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="80">是否调岗</td> 
                                            <td>
                                                <input type="checkboxk" name="shift" <{if $info.shift}>checkbox<{/if}>>是
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="80">调岗时间</td> 
                                            <td>
                                                <input type="text" name="shift_time" value="<{$info.shift_time}>" class="input-text" id="shift_time">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="80">调后岗位</td> 
                                            <td>
                                                <input type="text" name="new_station" value="<{$info.new_station}>" class="input-text" id="new_station">
                                            </td>
                                        </tr>
                                        
                                        </tbody>
                                        </table>
	
                                        <div class="bk15"></div>
                                        <{if $info}><input type="hidden" name="staff_id" value="<{$info.staff_id}>"/><{/if}>
                                        <input type="hidden" name="network_id" value="<{$network_id}>" />
                                        <input name="dosubmit" type="submit" value="提交" class="button">
                                        </form>
                                        </div>
                              </div>
                            </div>

                       </td>
                 </tr>
               </table>
       </td>
 </tr>
</table>
<{include file="../common/footer.tpl"}>
<script src="/js/jquery.uploadify.min.js"></script>
<script type="text/javascript">
    $('#uploadify').uploadify({
        //'debug': true,
        'buttonText' : '选择文件',
        'fileObjName' : 'upfile',   
        'swf'      : '/js/uploadify.swf',
        'fileTypeExts' : '*.gif; *.jpg; *.png',
        'uploader' : '/webadmin/attach/do?attach_type=other',
        'onUploadSuccess' : function(file, data, response) {
            var obj = eval('(' + data + ')');
            if (obj.state =='SUCCESS'){
                $('#cover').val(obj.url);
                $('#cases_img').html('<img src="'+obj.url+'" class="img-responsive">');
                alert('上传成功');
            } else {
                alert('上传失败');
            }
        } 
    });
</script>